feat: add a new switch component#960
Conversation
|
commit: |
…/qwik-ui into add_component_switch
I done |
|
it's weird, I have no idea with this error. I didn’t delete the tailwind file |
| onClick$={[handleClickSync$, handleClick$]} | ||
| > | ||
| <input | ||
| {...rest} |
There was a problem hiding this comment.
Looks like we need 4 pieces here:
Switch.Track, Switch.Thumb, Switch.Trigger (a button or div), and Switch.HiddenInput
But this is based on the current structure. I would follow the research process here:
|
I think we could merge this in as a draft state if you wanted to start consuming the current version. With the current feedback above a lot of changes are still needed to be prod ready. (and processes have improved since this PR) Props to the continued effort on this @JerryWu1234 💪 . Many parts of this were not documented, and have since been documented in qwik.design I will start writing some docs on form support as well |
|
Hey Jerry! Here's the new docs on form handling: |
|
Hey @JerryWu1234 let's remove this changeset since this would upgrade Qwik UI by a major version |
OK |
…/qwik-ui into add_component_switch
…ponent and updating examples
|
CLA Assistant Lite bot: I have read the CLA Document and I hereby sign the CLA 1 out of 2 committers have signed the CLA. |


What is it?
Switch Component Implementation
This PR implements a headless Switch component with the following features:
Features
role="switch"bind:checkedsignaldisabledcheckedonChange$onClick$autoFocusdefaultCheckedTest Coverage
Component Structure
SwitchRoot: Main component wrapperSwitchInput: Core switch functionalitySwitchLabel: Accessible labelingUsage Example
This implementation follows WAI-ARIA best practices and provides a flexible foundation for custom styling while maintaining accessibility.
Why is it needed?
Checklist:
pnpm changeand documented my changes